<template>
  <div>
    <br>
    <div v-on:click="back">
      <img src="/learning/jiantou.jpg" alt="">
    </div>
    <br>
    <br>
    <button @click="fun()">点我修改内容</button>
    <h1>{{this.$store.state.text}}</h1>
    
  </div>
</template> 

<script>
export default {
  methods:{
    fun(){
       this.$store.commit("learning","我是传递进来的而且刷新不会丢失哦")
    },
     back(){
         this.$router.go(-1);
       }
   
  }

}
</script>

<style scoped>
h1{
  margin-top: 0.5rem;
}

</style>